﻿using System;
using System.ComponentModel.DataAnnotations;
using OpusSuite.Utility;
using OpusSuite.Models.Model.WebAdmin;

namespace OpusSuite.Models.Model.Shared
{
    [Table("applicationmessage")]
    public class ApplicationMessage : ModelBase
    {
        public int Id { get; set; }

        [StringLength(1024)]
        public string Message { get; set; }
        [StringLength(1024)]
        public string Description { get; set; }

        public int TypeValue { get; set; }
        public Enums.ApplicationMessageType Type
        {
            get { return (Enums.ApplicationMessageType)TypeValue; }
            set { TypeValue = (int)value; }
        }

        public int LevelValue { get; set; }
        public Enums.ApplicationMessageLevel Level
        {
            get { return (Enums.ApplicationMessageLevel)LevelValue; }
            set { LevelValue = (int)value; }
        }
        
        public int LifetimeValue { get; set; }
        public Enums.ApplicationMessageLifetime Lifetime
        {
            get { return (Enums.ApplicationMessageLifetime)LifetimeValue; }
            set { LifetimeValue = (int)value; }
        }

        public DateTime MessageDate { get; set; }
        public virtual User MessageUser { get; set; }

        public bool ShowToUser { get; set; }

        public int Timeout { get; set; }

        public bool MarkForDeletion { get; set; }
    }
}
